using System;
using System.Collections.Generic;
using System.Text;
using AF_ORM.CORE;
using System.Data;
using System.Configuration;
using QuanLyThietBi.Config;     
using QuanLyThietBi.Entity;
namespace QuanLyThietBi.ManagerBase
{
                

     public abstract class TBL_ChiTietKeHoachBaoTriManagerBase
    {
        public TBL_ChiTietKeHoachBaoTriManagerBase()
        {
            Adapter.ConnectionString =  ConnectionConfig.ConnectionString;            
        }
                    
 
        /// <summary>
        /// Them moi du lieu
        /// </summary>
        /// <returns>TBL_ChiTietKeHoachBaoTriEntity</returns>
        public TBL_ChiTietKeHoachBaoTriEntity Insert(TBL_ChiTietKeHoachBaoTriEntity obj)
        { 
            return (TBL_ChiTietKeHoachBaoTriEntity) Adapter.Insert(obj);             
        }
 
 
        /// <summary>
        /// Update du lieu theo khoa chinh cua object
        /// </summary>
        /// <returns>TBL_ChiTietKeHoachBaoTriEntity</returns>
        public TBL_ChiTietKeHoachBaoTriEntity Update(TBL_ChiTietKeHoachBaoTriEntity obj)
        { 
            return (TBL_ChiTietKeHoachBaoTriEntity)Adapter.Update(obj);             
        }
 
 
        /// <summary>
        /// Update du lieu theo dieu kien trong object
        /// </summary>
        /// <returns>TBL_ChiTietKeHoachBaoTriEntity</returns>
        public TBL_ChiTietKeHoachBaoTriEntity UpdateWithCondition(TBL_ChiTietKeHoachBaoTriEntity obj,TBL_ChiTietKeHoachBaoTriEntity objCond)
        { 
            return (TBL_ChiTietKeHoachBaoTriEntity)Adapter.UpdateWithCondition(obj,objCond);             
        }
 
 
        public TBL_ChiTietKeHoachBaoTriEntity Delete(TBL_ChiTietKeHoachBaoTriEntity obj)
        { 
            return (TBL_ChiTietKeHoachBaoTriEntity)Adapter.Delete(obj);             
        }
 
 
        public TBL_ChiTietKeHoachBaoTriEntity DeleteWithCondition(TBL_ChiTietKeHoachBaoTriEntity objCond)
        { 
            return (TBL_ChiTietKeHoachBaoTriEntity)Adapter.DeleteWithCondition(objCond);             
        }
 


        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien DenNgay duoc set trong object
        /// </summary>
        /// <returns>TBL_ChiTietKeHoachBaoTriEntity</returns>
        public TBL_ChiTietKeHoachBaoTriEntity DeleteByDenNgay (TBL_ChiTietKeHoachBaoTriEntity obj)
        { 
            return (TBL_ChiTietKeHoachBaoTriEntity)Adapter.DeleteByField(obj,"DenNgay");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien DenNgay 
        /// </summary>
        /// <returns>TBL_ChiTietKeHoachBaoTriEntity</returns>
        public TBL_ChiTietKeHoachBaoTriEntity DeleteByDenNgay (string DenNgay )
        { 
            TBL_ChiTietKeHoachBaoTriEntity obj = new TBL_ChiTietKeHoachBaoTriEntity();
            obj.DenNgay = DenNgay;  
            return (TBL_ChiTietKeHoachBaoTriEntity)Adapter.DeleteByField(obj,"DenNgay");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien GhiChu duoc set trong object
        /// </summary>
        /// <returns>TBL_ChiTietKeHoachBaoTriEntity</returns>
        public TBL_ChiTietKeHoachBaoTriEntity DeleteByGhiChu (TBL_ChiTietKeHoachBaoTriEntity obj)
        { 
            return (TBL_ChiTietKeHoachBaoTriEntity)Adapter.DeleteByField(obj,"GhiChu");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien GhiChu 
        /// </summary>
        /// <returns>TBL_ChiTietKeHoachBaoTriEntity</returns>
        public TBL_ChiTietKeHoachBaoTriEntity DeleteByGhiChu (string GhiChu )
        { 
            TBL_ChiTietKeHoachBaoTriEntity obj = new TBL_ChiTietKeHoachBaoTriEntity();
            obj.GhiChu = GhiChu;  
            return (TBL_ChiTietKeHoachBaoTriEntity)Adapter.DeleteByField(obj,"GhiChu");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien MaCTBaoTri duoc set trong object
        /// </summary>
        /// <returns>TBL_ChiTietKeHoachBaoTriEntity</returns>
        public TBL_ChiTietKeHoachBaoTriEntity DeleteByMaCTBaoTri (TBL_ChiTietKeHoachBaoTriEntity obj)
        { 
            return (TBL_ChiTietKeHoachBaoTriEntity)Adapter.DeleteByField(obj,"MaCTBaoTri");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien MaCTBaoTri 
        /// </summary>
        /// <returns>TBL_ChiTietKeHoachBaoTriEntity</returns>
        public TBL_ChiTietKeHoachBaoTriEntity DeleteByMaCTBaoTri (string MaCTBaoTri )
        { 
            TBL_ChiTietKeHoachBaoTriEntity obj = new TBL_ChiTietKeHoachBaoTriEntity();
            obj.MaCTBaoTri = MaCTBaoTri;  
            return (TBL_ChiTietKeHoachBaoTriEntity)Adapter.DeleteByField(obj,"MaCTBaoTri");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien MaKeHoachBT duoc set trong object
        /// </summary>
        /// <returns>TBL_ChiTietKeHoachBaoTriEntity</returns>
        public TBL_ChiTietKeHoachBaoTriEntity DeleteByMaKeHoachBT (TBL_ChiTietKeHoachBaoTriEntity obj)
        { 
            return (TBL_ChiTietKeHoachBaoTriEntity)Adapter.DeleteByField(obj,"MaKeHoachBT");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien MaKeHoachBT 
        /// </summary>
        /// <returns>TBL_ChiTietKeHoachBaoTriEntity</returns>
        public TBL_ChiTietKeHoachBaoTriEntity DeleteByMaKeHoachBT (string MaKeHoachBT )
        { 
            TBL_ChiTietKeHoachBaoTriEntity obj = new TBL_ChiTietKeHoachBaoTriEntity();
            obj.MaKeHoachBT = MaKeHoachBT;  
            return (TBL_ChiTietKeHoachBaoTriEntity)Adapter.DeleteByField(obj,"MaKeHoachBT");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien MaPB duoc set trong object
        /// </summary>
        /// <returns>TBL_ChiTietKeHoachBaoTriEntity</returns>
        public TBL_ChiTietKeHoachBaoTriEntity DeleteByMaPB (TBL_ChiTietKeHoachBaoTriEntity obj)
        { 
            return (TBL_ChiTietKeHoachBaoTriEntity)Adapter.DeleteByField(obj,"MaPB");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien MaPB 
        /// </summary>
        /// <returns>TBL_ChiTietKeHoachBaoTriEntity</returns>
        public TBL_ChiTietKeHoachBaoTriEntity DeleteByMaPB (string MaPB )
        { 
            TBL_ChiTietKeHoachBaoTriEntity obj = new TBL_ChiTietKeHoachBaoTriEntity();
            obj.MaPB = MaPB;  
            return (TBL_ChiTietKeHoachBaoTriEntity)Adapter.DeleteByField(obj,"MaPB");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien TrangThai duoc set trong object
        /// </summary>
        /// <returns>TBL_ChiTietKeHoachBaoTriEntity</returns>
        public TBL_ChiTietKeHoachBaoTriEntity DeleteByTrangThai (TBL_ChiTietKeHoachBaoTriEntity obj)
        { 
            return (TBL_ChiTietKeHoachBaoTriEntity)Adapter.DeleteByField(obj,"TrangThai");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien TrangThai 
        /// </summary>
        /// <returns>TBL_ChiTietKeHoachBaoTriEntity</returns>
        public TBL_ChiTietKeHoachBaoTriEntity DeleteByTrangThai (string TrangThai )
        { 
            TBL_ChiTietKeHoachBaoTriEntity obj = new TBL_ChiTietKeHoachBaoTriEntity();
            obj.TrangThai = TrangThai;  
            return (TBL_ChiTietKeHoachBaoTriEntity)Adapter.DeleteByField(obj,"TrangThai");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien TuNgay duoc set trong object
        /// </summary>
        /// <returns>TBL_ChiTietKeHoachBaoTriEntity</returns>
        public TBL_ChiTietKeHoachBaoTriEntity DeleteByTuNgay (TBL_ChiTietKeHoachBaoTriEntity obj)
        { 
            return (TBL_ChiTietKeHoachBaoTriEntity)Adapter.DeleteByField(obj,"TuNgay");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien TuNgay 
        /// </summary>
        /// <returns>TBL_ChiTietKeHoachBaoTriEntity</returns>
        public TBL_ChiTietKeHoachBaoTriEntity DeleteByTuNgay (string TuNgay )
        { 
            TBL_ChiTietKeHoachBaoTriEntity obj = new TBL_ChiTietKeHoachBaoTriEntity();
            obj.TuNgay = TuNgay;  
            return (TBL_ChiTietKeHoachBaoTriEntity)Adapter.DeleteByField(obj,"TuNgay");
        }

 
        /// <summary>
        /// Lay du lieu theo khoa chinh object
        /// </summary>
        /// <returns></returns>
        public TBL_ChiTietKeHoachBaoTriEntity Select(TBL_ChiTietKeHoachBaoTriEntity obj)
        { 
            return (TBL_ChiTietKeHoachBaoTriEntity) Adapter.Select(obj);             
        }
 
 
        /// <summary>
        /// Lay du lieu theo cac dieu kien duoc set trong object
        /// </summary>
        /// <returns></returns>
        public DataTable SelectWithCondition(TBL_ChiTietKeHoachBaoTriEntity obj)
        { 
            return  Adapter.SelectWithCondition(obj);             
        }
 
 
        /// <summary>
        /// Lay du lieu theo cac dieu kien duoc set trong object
        /// </summary>
        /// <returns></returns>
        public DataTable SelectWithCondition(TBL_ChiTietKeHoachBaoTriEntity obj,SelectOptions option)
        {             
            return  Adapter.SelectWithCondition(obj,option);             
        }
 
 
        /// <summary>
        /// Lay tat ca cac du lieu trong table
        /// </summary>
        /// <returns></returns>
        public DataTable SelectAll()
        { 
            return Adapter.SelectAll(new TBL_ChiTietKeHoachBaoTriEntity());             
        }
 
 
        /// <summary>
        /// Lay tat ca cac du lieu trong table
        /// </summary>
        /// <returns></returns>
        public DataTable SelectAll(SelectOptions option)
        { 
            return Adapter.SelectAll(new TBL_ChiTietKeHoachBaoTriEntity(),option);             
        }
 
 
        /// <summary>
        /// Lay tat ca cac du lieu trong table
        /// </summary>
        /// <returns></returns>
        public List<TBL_ChiTietKeHoachBaoTriEntity> SelectAllLST()
        { 
            return  (List<TBL_ChiTietKeHoachBaoTriEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectAll(new TBL_ChiTietKeHoachBaoTriEntity()),new TBL_ChiTietKeHoachBaoTriEntity());           
        }
 
 
        /// <summary>
        /// Lay tat ca cac du lieu trong table
        /// </summary>
        /// <returns></returns>
        public List<TBL_ChiTietKeHoachBaoTriEntity> SelectAllLST(SelectOptions option)
        { 
            return (List<TBL_ChiTietKeHoachBaoTriEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectAll(new TBL_ChiTietKeHoachBaoTriEntity(),option),new TBL_ChiTietKeHoachBaoTriEntity());             
        }
 

        /// <summary>
        /// Lay du lieu theo cac dieu kien DenNgay duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByDenNgay (TBL_ChiTietKeHoachBaoTriEntity obj)
        { 
            return Adapter.SelectByField(obj,"DenNgay");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien DenNgay duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByDenNgay (TBL_ChiTietKeHoachBaoTriEntity obj,SelectOptions option)
        { 
            return Adapter.SelectByField(obj,"DenNgay",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien DenNgay duoc set trong object
        /// </summary>
        /// <returns>List<TBL_ChiTietKeHoachBaoTriEntity></returns>
        public List<TBL_ChiTietKeHoachBaoTriEntity> SelectByDenNgayLST (TBL_ChiTietKeHoachBaoTriEntity obj)
        { 
            return  (List<TBL_ChiTietKeHoachBaoTriEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"DenNgay"),new TBL_ChiTietKeHoachBaoTriEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien DenNgay duoc set trong object
        /// </summary>
        /// <returns>List<TBL_ChiTietKeHoachBaoTriEntity></returns>
        public List<TBL_ChiTietKeHoachBaoTriEntity> SelectByDenNgayLST (TBL_ChiTietKeHoachBaoTriEntity obj,SelectOptions option)
        { 
            return  (List<TBL_ChiTietKeHoachBaoTriEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectByField(obj,"DenNgay",option),new TBL_ChiTietKeHoachBaoTriEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien DenNgay 
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByDenNgay (string DenNgay )
        { 
            TBL_ChiTietKeHoachBaoTriEntity obj = new TBL_ChiTietKeHoachBaoTriEntity();
            obj.DenNgay = DenNgay;  
            return Adapter.SelectByField(obj,"DenNgay");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien DenNgay duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByDenNgay (string DenNgay, SelectOptions option)
        { 
            TBL_ChiTietKeHoachBaoTriEntity obj = new TBL_ChiTietKeHoachBaoTriEntity();
            obj.DenNgay = DenNgay;  
            return Adapter.SelectByField(obj,"DenNgay",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien DenNgay 
        /// </summary>
        /// <returns>DataTable</returns>
        public List<TBL_ChiTietKeHoachBaoTriEntity> SelectByDenNgayLST (string DenNgay )
        { 
            TBL_ChiTietKeHoachBaoTriEntity obj = new TBL_ChiTietKeHoachBaoTriEntity();
            obj.DenNgay = DenNgay;  
            return  (List<TBL_ChiTietKeHoachBaoTriEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"DenNgay"),new TBL_ChiTietKeHoachBaoTriEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien DenNgay duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public List<TBL_ChiTietKeHoachBaoTriEntity> SelectByDenNgayLST (string DenNgay, SelectOptions option)
        { 
            TBL_ChiTietKeHoachBaoTriEntity obj = new TBL_ChiTietKeHoachBaoTriEntity();
            obj.DenNgay = DenNgay;  
            return  (List<TBL_ChiTietKeHoachBaoTriEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"DenNgay",option),new TBL_ChiTietKeHoachBaoTriEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien GhiChu duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByGhiChu (TBL_ChiTietKeHoachBaoTriEntity obj)
        { 
            return Adapter.SelectByField(obj,"GhiChu");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien GhiChu duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByGhiChu (TBL_ChiTietKeHoachBaoTriEntity obj,SelectOptions option)
        { 
            return Adapter.SelectByField(obj,"GhiChu",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien GhiChu duoc set trong object
        /// </summary>
        /// <returns>List<TBL_ChiTietKeHoachBaoTriEntity></returns>
        public List<TBL_ChiTietKeHoachBaoTriEntity> SelectByGhiChuLST (TBL_ChiTietKeHoachBaoTriEntity obj)
        { 
            return  (List<TBL_ChiTietKeHoachBaoTriEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"GhiChu"),new TBL_ChiTietKeHoachBaoTriEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien GhiChu duoc set trong object
        /// </summary>
        /// <returns>List<TBL_ChiTietKeHoachBaoTriEntity></returns>
        public List<TBL_ChiTietKeHoachBaoTriEntity> SelectByGhiChuLST (TBL_ChiTietKeHoachBaoTriEntity obj,SelectOptions option)
        { 
            return  (List<TBL_ChiTietKeHoachBaoTriEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectByField(obj,"GhiChu",option),new TBL_ChiTietKeHoachBaoTriEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien GhiChu 
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByGhiChu (string GhiChu )
        { 
            TBL_ChiTietKeHoachBaoTriEntity obj = new TBL_ChiTietKeHoachBaoTriEntity();
            obj.GhiChu = GhiChu;  
            return Adapter.SelectByField(obj,"GhiChu");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien GhiChu duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByGhiChu (string GhiChu, SelectOptions option)
        { 
            TBL_ChiTietKeHoachBaoTriEntity obj = new TBL_ChiTietKeHoachBaoTriEntity();
            obj.GhiChu = GhiChu;  
            return Adapter.SelectByField(obj,"GhiChu",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien GhiChu 
        /// </summary>
        /// <returns>DataTable</returns>
        public List<TBL_ChiTietKeHoachBaoTriEntity> SelectByGhiChuLST (string GhiChu )
        { 
            TBL_ChiTietKeHoachBaoTriEntity obj = new TBL_ChiTietKeHoachBaoTriEntity();
            obj.GhiChu = GhiChu;  
            return  (List<TBL_ChiTietKeHoachBaoTriEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"GhiChu"),new TBL_ChiTietKeHoachBaoTriEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien GhiChu duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public List<TBL_ChiTietKeHoachBaoTriEntity> SelectByGhiChuLST (string GhiChu, SelectOptions option)
        { 
            TBL_ChiTietKeHoachBaoTriEntity obj = new TBL_ChiTietKeHoachBaoTriEntity();
            obj.GhiChu = GhiChu;  
            return  (List<TBL_ChiTietKeHoachBaoTriEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"GhiChu",option),new TBL_ChiTietKeHoachBaoTriEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaCTBaoTri duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByMaCTBaoTri (TBL_ChiTietKeHoachBaoTriEntity obj)
        { 
            return Adapter.SelectByField(obj,"MaCTBaoTri");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaCTBaoTri duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByMaCTBaoTri (TBL_ChiTietKeHoachBaoTriEntity obj,SelectOptions option)
        { 
            return Adapter.SelectByField(obj,"MaCTBaoTri",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaCTBaoTri duoc set trong object
        /// </summary>
        /// <returns>List<TBL_ChiTietKeHoachBaoTriEntity></returns>
        public List<TBL_ChiTietKeHoachBaoTriEntity> SelectByMaCTBaoTriLST (TBL_ChiTietKeHoachBaoTriEntity obj)
        { 
            return  (List<TBL_ChiTietKeHoachBaoTriEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"MaCTBaoTri"),new TBL_ChiTietKeHoachBaoTriEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaCTBaoTri duoc set trong object
        /// </summary>
        /// <returns>List<TBL_ChiTietKeHoachBaoTriEntity></returns>
        public List<TBL_ChiTietKeHoachBaoTriEntity> SelectByMaCTBaoTriLST (TBL_ChiTietKeHoachBaoTriEntity obj,SelectOptions option)
        { 
            return  (List<TBL_ChiTietKeHoachBaoTriEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectByField(obj,"MaCTBaoTri",option),new TBL_ChiTietKeHoachBaoTriEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaCTBaoTri 
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByMaCTBaoTri (string MaCTBaoTri )
        { 
            TBL_ChiTietKeHoachBaoTriEntity obj = new TBL_ChiTietKeHoachBaoTriEntity();
            obj.MaCTBaoTri = MaCTBaoTri;  
            return Adapter.SelectByField(obj,"MaCTBaoTri");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaCTBaoTri duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByMaCTBaoTri (string MaCTBaoTri, SelectOptions option)
        { 
            TBL_ChiTietKeHoachBaoTriEntity obj = new TBL_ChiTietKeHoachBaoTriEntity();
            obj.MaCTBaoTri = MaCTBaoTri;  
            return Adapter.SelectByField(obj,"MaCTBaoTri",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaCTBaoTri 
        /// </summary>
        /// <returns>DataTable</returns>
        public List<TBL_ChiTietKeHoachBaoTriEntity> SelectByMaCTBaoTriLST (string MaCTBaoTri )
        { 
            TBL_ChiTietKeHoachBaoTriEntity obj = new TBL_ChiTietKeHoachBaoTriEntity();
            obj.MaCTBaoTri = MaCTBaoTri;  
            return  (List<TBL_ChiTietKeHoachBaoTriEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"MaCTBaoTri"),new TBL_ChiTietKeHoachBaoTriEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaCTBaoTri duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public List<TBL_ChiTietKeHoachBaoTriEntity> SelectByMaCTBaoTriLST (string MaCTBaoTri, SelectOptions option)
        { 
            TBL_ChiTietKeHoachBaoTriEntity obj = new TBL_ChiTietKeHoachBaoTriEntity();
            obj.MaCTBaoTri = MaCTBaoTri;  
            return  (List<TBL_ChiTietKeHoachBaoTriEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"MaCTBaoTri",option),new TBL_ChiTietKeHoachBaoTriEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaKeHoachBT duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByMaKeHoachBT (TBL_ChiTietKeHoachBaoTriEntity obj)
        { 
            return Adapter.SelectByField(obj,"MaKeHoachBT");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaKeHoachBT duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByMaKeHoachBT (TBL_ChiTietKeHoachBaoTriEntity obj,SelectOptions option)
        { 
            return Adapter.SelectByField(obj,"MaKeHoachBT",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaKeHoachBT duoc set trong object
        /// </summary>
        /// <returns>List<TBL_ChiTietKeHoachBaoTriEntity></returns>
        public List<TBL_ChiTietKeHoachBaoTriEntity> SelectByMaKeHoachBTLST (TBL_ChiTietKeHoachBaoTriEntity obj)
        { 
            return  (List<TBL_ChiTietKeHoachBaoTriEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"MaKeHoachBT"),new TBL_ChiTietKeHoachBaoTriEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaKeHoachBT duoc set trong object
        /// </summary>
        /// <returns>List<TBL_ChiTietKeHoachBaoTriEntity></returns>
        public List<TBL_ChiTietKeHoachBaoTriEntity> SelectByMaKeHoachBTLST (TBL_ChiTietKeHoachBaoTriEntity obj,SelectOptions option)
        { 
            return  (List<TBL_ChiTietKeHoachBaoTriEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectByField(obj,"MaKeHoachBT",option),new TBL_ChiTietKeHoachBaoTriEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaKeHoachBT 
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByMaKeHoachBT (string MaKeHoachBT )
        { 
            TBL_ChiTietKeHoachBaoTriEntity obj = new TBL_ChiTietKeHoachBaoTriEntity();
            obj.MaKeHoachBT = MaKeHoachBT;  
            return Adapter.SelectByField(obj,"MaKeHoachBT");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaKeHoachBT duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByMaKeHoachBT (string MaKeHoachBT, SelectOptions option)
        { 
            TBL_ChiTietKeHoachBaoTriEntity obj = new TBL_ChiTietKeHoachBaoTriEntity();
            obj.MaKeHoachBT = MaKeHoachBT;  
            return Adapter.SelectByField(obj,"MaKeHoachBT",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaKeHoachBT 
        /// </summary>
        /// <returns>DataTable</returns>
        public List<TBL_ChiTietKeHoachBaoTriEntity> SelectByMaKeHoachBTLST (string MaKeHoachBT )
        { 
            TBL_ChiTietKeHoachBaoTriEntity obj = new TBL_ChiTietKeHoachBaoTriEntity();
            obj.MaKeHoachBT = MaKeHoachBT;  
            return  (List<TBL_ChiTietKeHoachBaoTriEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"MaKeHoachBT"),new TBL_ChiTietKeHoachBaoTriEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaKeHoachBT duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public List<TBL_ChiTietKeHoachBaoTriEntity> SelectByMaKeHoachBTLST (string MaKeHoachBT, SelectOptions option)
        { 
            TBL_ChiTietKeHoachBaoTriEntity obj = new TBL_ChiTietKeHoachBaoTriEntity();
            obj.MaKeHoachBT = MaKeHoachBT;  
            return  (List<TBL_ChiTietKeHoachBaoTriEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"MaKeHoachBT",option),new TBL_ChiTietKeHoachBaoTriEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaPB duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByMaPB (TBL_ChiTietKeHoachBaoTriEntity obj)
        { 
            return Adapter.SelectByField(obj,"MaPB");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaPB duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByMaPB (TBL_ChiTietKeHoachBaoTriEntity obj,SelectOptions option)
        { 
            return Adapter.SelectByField(obj,"MaPB",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaPB duoc set trong object
        /// </summary>
        /// <returns>List<TBL_ChiTietKeHoachBaoTriEntity></returns>
        public List<TBL_ChiTietKeHoachBaoTriEntity> SelectByMaPBLST (TBL_ChiTietKeHoachBaoTriEntity obj)
        { 
            return  (List<TBL_ChiTietKeHoachBaoTriEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"MaPB"),new TBL_ChiTietKeHoachBaoTriEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaPB duoc set trong object
        /// </summary>
        /// <returns>List<TBL_ChiTietKeHoachBaoTriEntity></returns>
        public List<TBL_ChiTietKeHoachBaoTriEntity> SelectByMaPBLST (TBL_ChiTietKeHoachBaoTriEntity obj,SelectOptions option)
        { 
            return  (List<TBL_ChiTietKeHoachBaoTriEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectByField(obj,"MaPB",option),new TBL_ChiTietKeHoachBaoTriEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaPB 
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByMaPB (string MaPB )
        { 
            TBL_ChiTietKeHoachBaoTriEntity obj = new TBL_ChiTietKeHoachBaoTriEntity();
            obj.MaPB = MaPB;  
            return Adapter.SelectByField(obj,"MaPB");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaPB duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByMaPB (string MaPB, SelectOptions option)
        { 
            TBL_ChiTietKeHoachBaoTriEntity obj = new TBL_ChiTietKeHoachBaoTriEntity();
            obj.MaPB = MaPB;  
            return Adapter.SelectByField(obj,"MaPB",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaPB 
        /// </summary>
        /// <returns>DataTable</returns>
        public List<TBL_ChiTietKeHoachBaoTriEntity> SelectByMaPBLST (string MaPB )
        { 
            TBL_ChiTietKeHoachBaoTriEntity obj = new TBL_ChiTietKeHoachBaoTriEntity();
            obj.MaPB = MaPB;  
            return  (List<TBL_ChiTietKeHoachBaoTriEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"MaPB"),new TBL_ChiTietKeHoachBaoTriEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaPB duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public List<TBL_ChiTietKeHoachBaoTriEntity> SelectByMaPBLST (string MaPB, SelectOptions option)
        { 
            TBL_ChiTietKeHoachBaoTriEntity obj = new TBL_ChiTietKeHoachBaoTriEntity();
            obj.MaPB = MaPB;  
            return  (List<TBL_ChiTietKeHoachBaoTriEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"MaPB",option),new TBL_ChiTietKeHoachBaoTriEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien TrangThai duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByTrangThai (TBL_ChiTietKeHoachBaoTriEntity obj)
        { 
            return Adapter.SelectByField(obj,"TrangThai");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien TrangThai duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByTrangThai (TBL_ChiTietKeHoachBaoTriEntity obj,SelectOptions option)
        { 
            return Adapter.SelectByField(obj,"TrangThai",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien TrangThai duoc set trong object
        /// </summary>
        /// <returns>List<TBL_ChiTietKeHoachBaoTriEntity></returns>
        public List<TBL_ChiTietKeHoachBaoTriEntity> SelectByTrangThaiLST (TBL_ChiTietKeHoachBaoTriEntity obj)
        { 
            return  (List<TBL_ChiTietKeHoachBaoTriEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"TrangThai"),new TBL_ChiTietKeHoachBaoTriEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien TrangThai duoc set trong object
        /// </summary>
        /// <returns>List<TBL_ChiTietKeHoachBaoTriEntity></returns>
        public List<TBL_ChiTietKeHoachBaoTriEntity> SelectByTrangThaiLST (TBL_ChiTietKeHoachBaoTriEntity obj,SelectOptions option)
        { 
            return  (List<TBL_ChiTietKeHoachBaoTriEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectByField(obj,"TrangThai",option),new TBL_ChiTietKeHoachBaoTriEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien TrangThai 
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByTrangThai (string TrangThai )
        { 
            TBL_ChiTietKeHoachBaoTriEntity obj = new TBL_ChiTietKeHoachBaoTriEntity();
            obj.TrangThai = TrangThai;  
            return Adapter.SelectByField(obj,"TrangThai");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien TrangThai duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByTrangThai (string TrangThai, SelectOptions option)
        { 
            TBL_ChiTietKeHoachBaoTriEntity obj = new TBL_ChiTietKeHoachBaoTriEntity();
            obj.TrangThai = TrangThai;  
            return Adapter.SelectByField(obj,"TrangThai",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien TrangThai 
        /// </summary>
        /// <returns>DataTable</returns>
        public List<TBL_ChiTietKeHoachBaoTriEntity> SelectByTrangThaiLST (string TrangThai )
        { 
            TBL_ChiTietKeHoachBaoTriEntity obj = new TBL_ChiTietKeHoachBaoTriEntity();
            obj.TrangThai = TrangThai;  
            return  (List<TBL_ChiTietKeHoachBaoTriEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"TrangThai"),new TBL_ChiTietKeHoachBaoTriEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien TrangThai duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public List<TBL_ChiTietKeHoachBaoTriEntity> SelectByTrangThaiLST (string TrangThai, SelectOptions option)
        { 
            TBL_ChiTietKeHoachBaoTriEntity obj = new TBL_ChiTietKeHoachBaoTriEntity();
            obj.TrangThai = TrangThai;  
            return  (List<TBL_ChiTietKeHoachBaoTriEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"TrangThai",option),new TBL_ChiTietKeHoachBaoTriEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien TuNgay duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByTuNgay (TBL_ChiTietKeHoachBaoTriEntity obj)
        { 
            return Adapter.SelectByField(obj,"TuNgay");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien TuNgay duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByTuNgay (TBL_ChiTietKeHoachBaoTriEntity obj,SelectOptions option)
        { 
            return Adapter.SelectByField(obj,"TuNgay",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien TuNgay duoc set trong object
        /// </summary>
        /// <returns>List<TBL_ChiTietKeHoachBaoTriEntity></returns>
        public List<TBL_ChiTietKeHoachBaoTriEntity> SelectByTuNgayLST (TBL_ChiTietKeHoachBaoTriEntity obj)
        { 
            return  (List<TBL_ChiTietKeHoachBaoTriEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"TuNgay"),new TBL_ChiTietKeHoachBaoTriEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien TuNgay duoc set trong object
        /// </summary>
        /// <returns>List<TBL_ChiTietKeHoachBaoTriEntity></returns>
        public List<TBL_ChiTietKeHoachBaoTriEntity> SelectByTuNgayLST (TBL_ChiTietKeHoachBaoTriEntity obj,SelectOptions option)
        { 
            return  (List<TBL_ChiTietKeHoachBaoTriEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectByField(obj,"TuNgay",option),new TBL_ChiTietKeHoachBaoTriEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien TuNgay 
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByTuNgay (string TuNgay )
        { 
            TBL_ChiTietKeHoachBaoTriEntity obj = new TBL_ChiTietKeHoachBaoTriEntity();
            obj.TuNgay = TuNgay;  
            return Adapter.SelectByField(obj,"TuNgay");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien TuNgay duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByTuNgay (string TuNgay, SelectOptions option)
        { 
            TBL_ChiTietKeHoachBaoTriEntity obj = new TBL_ChiTietKeHoachBaoTriEntity();
            obj.TuNgay = TuNgay;  
            return Adapter.SelectByField(obj,"TuNgay",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien TuNgay 
        /// </summary>
        /// <returns>DataTable</returns>
        public List<TBL_ChiTietKeHoachBaoTriEntity> SelectByTuNgayLST (string TuNgay )
        { 
            TBL_ChiTietKeHoachBaoTriEntity obj = new TBL_ChiTietKeHoachBaoTriEntity();
            obj.TuNgay = TuNgay;  
            return  (List<TBL_ChiTietKeHoachBaoTriEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"TuNgay"),new TBL_ChiTietKeHoachBaoTriEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien TuNgay duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public List<TBL_ChiTietKeHoachBaoTriEntity> SelectByTuNgayLST (string TuNgay, SelectOptions option)
        { 
            TBL_ChiTietKeHoachBaoTriEntity obj = new TBL_ChiTietKeHoachBaoTriEntity();
            obj.TuNgay = TuNgay;  
            return  (List<TBL_ChiTietKeHoachBaoTriEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"TuNgay",option),new TBL_ChiTietKeHoachBaoTriEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien duoc set trong object
        /// </summary>
        /// <returns>List<TBL_ChiTietKeHoachBaoTriEntity></returns>
        public List<TBL_ChiTietKeHoachBaoTriEntity> SelectWithConditionLST (TBL_ChiTietKeHoachBaoTriEntity obj)
        { 
            return  (List<TBL_ChiTietKeHoachBaoTriEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectWithCondition(obj),new TBL_ChiTietKeHoachBaoTriEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien duoc set trong object
        /// </summary>
        /// <returns>List<TBL_ChiTietKeHoachBaoTriEntity></returns>
        public List<TBL_ChiTietKeHoachBaoTriEntity> SelectWithConditionLST (TBL_ChiTietKeHoachBaoTriEntity obj,SelectOptions option)
        { 
            return  (List<TBL_ChiTietKeHoachBaoTriEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectWithCondition(obj,option),new TBL_ChiTietKeHoachBaoTriEntity());
        }

}
}
